# -*- coding: UTF-8 -*-

from bayes import bayes_func

if __name__ == '__main__':
	posting_list, class_vec = bayes_func.load_data_set()
	vocab_list = bayes_func.create_vocab_list(posting_list)

	train_mat = []
	for doc in posting_list:
		train_mat.append(bayes_func.set_of_words_2_vec(vocab_list, doc))

	p0_v, p1_v, p_ab = bayes_func.train_nbo(train_mat, class_vec)
	print(p0_v)
	print(p1_v)
	print(p_ab)
